﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SystemCenterSoa.PoModel.SystemManager.MyModelPo;
using SystemCenterSoa.Repository.CommonLib;

namespace SystemCenterSoa.ApiProject.Area.SystemManager
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CountryController : ControllerBase
    {
        protected SystemCenterDbSoaContext _systemCenterDbSoaContext;

        //注入ef的的上下文
        public CountryController(SystemCenterDbSoaContext systemCenterDbSoaContext)
        {
            _systemCenterDbSoaContext = systemCenterDbSoaContext;

        }

        [HttpGet]
        public List<CountryPo> GetCountryList(int id)
        {
            return _systemCenterDbSoaContext.CountryPo.Where(a => a.p_id == id).ToList();
        }
    }
}
